#!/usr/bin/python
# -*-coding: UTF-8 -*-
"""
# Time: 2025/3/25 16:10
# @Project_name: PROJECT_NAME
"""

# int、  str、 float、  boolean

# int 类型
a = 100
b = 30
print("a的类型：", type(a))
c = a / b  # 求商
d = a % b  # 求余数
m = 10.5
e = m + a
print(f"求商：c = {c}, 求余数：d = {d}, 求和：e = {e}")

# float 类型
a = 9.9
b = 3.3
c = a / b
d = a % b
print(f"c = {c}, d = {d}")
print(f"c = {int(c)}, d = {int(d)}")

# str 类型
m = 'hello'
n = 'world!'
c = m + " " + n
print(type(c))
print("输出c: ", c)
o = 100
print("o的类型", type(o))
p = str(o)
print("p的类型", type(p))

strs = "aBcD"
# 字符的切片
print(strs[:])
print(strs[1:])
print(strs[:1])
print("下标从零开始, 步长为1", strs[0::2])


# 字符的特殊方法
print("长度：", len(strs))
strs.join("Ef")
print(strs)
print(strs.replace("a", "97"))
print("返回Unicode编码为x的字符：", chr(97))
print("返回字符x的Unicode的编码：", ord('A'))





